<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>List Admin Information</title>
</head>
<body>
<h1>${listAdmin.msg}</h1>

<h2>显示管理员列表:</h2>
<hr>
<a href="showAllUserInfo.do">添加管理员</a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<a href="/admin/index.do">返回管理员首页</a>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<a href="personalLog.do">查看个人日志信息</a>
<hr>
<table>
    <tr>
        <td>管理员账号</td>
        <td>管理员注册时间</td>
        <td>管理员Email</td>
    </tr>
    <c:forEach var="admin" items="${listAdmin.listAdmin}">
        <tr>
            <td><a href="showAdminLog.do?adminId=${admin.id}">${admin.userName}</a></td>
            <td><fmt:formatDate value="${admin.loginTime}" pattern="yyyy年MM月dd日 HH:mm:ss"/></td>
            <td>${admin.email}</td>
            <td><a href="deleteOrAddAdmin.do?adminId=${admin.id}&flagValue=0" onclick="return yesOrNo()">删除</a></td>
        </tr>
    </c:forEach>
</table>
<script language="javascript">
    function yesOrNo() {
        if (confirm("您确定取消该用户的管理员权限吗?")) {
            return true;
        } else
            return false;
    }
</script>
</body>
</html>